<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<%
			String basepath = request.getContextPath();
		%>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link href="<%=basepath%>/css/account.css" rel="stylesheet" type="text/css" />
		<script src="js/jquery-1.4.4.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript" src="<%=basepath%>/js/register.js"></script>
		<script language="javascript" type="text/javascript" src="<%=basepath%>/js/common.js"></script>
		<script language="javascript" type="text/javascript" src="<%=basepath%>/js/utilTool.js"></script>
		<script language="javascript" type="text/javascript" src="<%=basepath%>/js/validatorTool.js"></script>
		
		<link type="text/css" rel="stylesheet" href="<%=basepath%>/newcalendar/calendar.css" />
	<script language="javascript" type="text/javascript" src="<%=basepath%>/newcalendar/calendar.js"></script>
	<script language="javascript" type="text/javascript" src="<%=basepath%>/newcalendar/calendar-zh.js"></script>
	<script language="javascript" type="text/javascript" src="<%=basepath%>/newcalendar/calendar-setup.js"></script>
		
<style type="text/css">
.mycolor {
	color: #FF0000;
}
</style>
<script type="text/javascript">
		
	jQuery(document).ready(
		function(){
			//供应商类型
			initselect("suptype",'${currentInfo.suptype}');
			//企业性质
			//initselect("entproperty",'${currentInfo.entproperty}');
			//初始化两个字段：所属行业，经济类型
			initmodel("industryname,ectypename","${currentInfo.industry}"+","+"${currentInfo.ectype}");
		}
	)
	
	//初始化参考数据的名称
	function initmodel(name,pk){
		jQuery.ajax({
				type: "GET", 
	            async:false,
	            url:"<%=basepath%>/register/initmodel?pk="+pk, 
	            dataType:"text", 
	            success:function(result){   
	                if(result !=''){
	                	var items = result.split("|");
	                	var nameitem = name.split(",");
	                	for(var i=0;i<nameitem.length;i++){
	                		if(i<items.length){
	                			document.getElementById(nameitem[i]).value = items[i];
	                		}
	                	}
	                }
	            } 
	        }
		)
	}
	//这里进行提交
	function nextStep() {
		var valid = checkSupInfo(1);
		if(valid ==false){
			return false;
		}
		var obj = document.all;
		if(isValidBuildDate(obj.builddate) && subReduNumRegFund(obj.regfound,2,13)){
			document.forms[0].action = "<%=basepath %>/register/inviteNextStep?nextStep=2";
			document.forms[0].submit();
		}
	}
	
	function save(){
		//var valid = checkSupInfo(1);
		//if(valid ==false){
		//	return false;
		//}
		var obj = document.all;
		if(isValidBuildDate(obj.builddate) && subReduNumRegFund(obj.regfound,2,13)){
			document.forms[0].action = "<%=basepath %>/register/inviteSaveSupInfo?step=1";
			document.forms[0].submit();
		}
	}

	function initList(id,code){
		var url = "iframe:<%=basepath%>/register/initlist?id="+id+"&code="+code;
		dialog("", url,"500", "400", "","");
	}
	
	function isValidBuildDate(obj){
		if(!isEmpty(obj.value) && !isDate(obj.value)){
			jQuery("#message").html("请重新输入YYYY-MM-DD格式日期");
			obj.focus();
			return false;
		}else{
			jQuery("#message").html("");
			return true;
		}
	}
</script>
	</head>
	<body class="fullbody">
		<div id="content" class="content">
			<div class="">
				<b class="rtop"><b class="r1"></b><b class="r2"></b><b
					class="r3"></b><b class="r4"> </b> </b>
				<table cellpadding="0" cellspacing="0" border="0" width="980">
					<tr>
						<td class="leftmargin">
						</td>
						<td valign="top" align="left">
							<form method="post">
								<table cellpadding="0" cellspacing="0" border="0" width="920">
									<tr class="inputrow">
										<td  align="right"  colspan="4">
											<a href="javascript:void(null);" onclick="doHelp('<%=request.getContextPath()%>/help/html/YQZC.html');" style="text-decoration: underline;">[填写说明]</a>
										</td>
									</tr>
									<tr class="inputrow">
										<td class="w1">供应商全称：</td>
										<td class="w5">
											<input type="hidden" name="pk_supinfocheck_h"
												value="${currentInfo.pk_supinfocheck_h}" />
											<input type="text" name="supname" class="textstyle"
												value="${currentInfo.supname}" />
											<span class="needfill">*</span>
											<font class="memoFont">（与营业执照一致）</font>
										</td>
										<td class="w1">英文全称：</td>
										<td class="w5">
											<input type="text" name="supenname" class="textstyle"
												value="${currentInfo.supenname}" />
										</td>
										<input type="hidden" name="suptype"  value="1"/>
										<input type="hidden" name="supCate" 
												value="${currentInfo.supCate}" class="textstyle" readOnly />
										<input type="hidden" name="parentSup"
												value="${currentInfo.parentSup}" class="textstyle" readOnly/>
									</tr>
									<!--<tr class="inputrow">
										<td class="w1">供应商简称：</td>
										<td class="w5">
											<input type="text" name="supsimname"
												value="${currentInfo.supsimname}" class="textstyle" />
											
											<input type="hidden" name="suptype"  value="1"/>
											<input type="hidden" name="supCate" 
												value="${currentInfo.supCate}" class="textstyle" readOnly />
											<input type="hidden" name="parentSup"
												value="${currentInfo.parentSup}" class="textstyle" readOnly/>
<!-- 											<input type="hidden" name="supCate" -->
<!-- 												value="${currentInfo.supCate}" class="textstyle" readOnly /> 
										</td>-->
<!--										<td class="w1">供应商类型：</td>-->
<!--										<td class="w5">-->
<!--											<select name="suptype" id="suptype" class="textstyle" disabled>-->
<!--												<option value="0">外部单位</option>-->
<!--												<option value="1">内部单位</option>-->
<!--											</select>-->
<!--										</td>-->
<!--										<td class="w1">供应商基本分类：</td>-->
<!--										<td class="w5">-->
<!-- 											<input type="text" name="supCateName"-->
<!-- 												value="${currentInfo.supCateName}" class="textstyle" readOnly />-->
<!-- 										</td> -->
<!-- 									</tr>-->
<!--									<tr class="inputrow">-->
<!--										<td class="w1">上级供应商：</td>-->
<!--										<td class="w5">-->
											
<!--											<input type="text" name="parentSupName"-->
<!--												value="${currentInfo.parentSupName}" class="textstyle" readOnly/>-->
<!--									</td>-->
										<!--<td class="w1">邀请人：</td>
										<td class="w5">
											<input type="hidden" name="invitePsn"
												value="${currentInfo.invitePsn}" class="textstyle" readOnly/>
											<input type="text" name="invitePsnName"
												value="${currentInfo.invitePsnName}" class="textstyle" readOnly/>
										</td>
										</tr>-->
									<!--<tr class="inputrow">
										<td class="w1">邀请日期：</td>
										<td class="w5">
											<input type="text" name="inviteDate"
												value="${currentInfo.inviteDate}" class="textstyle" readOnly/>
										</td>
										<td class="w1">所属行业：</td>
										<td class="w5">
											<input type="text" name="industryname" id="industryname" class="textstyle"
												value="${currentInfo.industryname}"	onclick="initList('industry','SYS005')" readOnly/>
											<input type="hidden" name="industry" id="industry" class="textstyle"
												value="${currentInfo.industry}" readOnly/>
										</td>
									</tr>
									-->
									<tr class="inputrow">
										<td class="w1">经济类型：</td>
										<td class="w5">
											<input type="text" name="ectypename" id="ectypename" value="${currentInfo.ectypename}"
												 class="textstyle" onclick="initList('ectype','SYS004_0xx')" readOnly/> 
											<input type="hidden" name="ectype" id="ectype"
												value="${currentInfo.ectype}" class="textstyle"  readOnly/>
												<span class="needfill">*</span>
										</td>
										<td class="w1">银行资信等级：</td>
										<td class="w5">
											<select name="bankcreditrank"  class="textstyle" >
												<option value="3" <c:if test="${3==currentInfo.bankcreditrank}">selected</c:if>>
													3A
												</option>  
												<option value="2" <c:if test="${2==currentInfo.bankcreditrank}">selected</c:if>>
													2A
												</option>
												<option value="1" <c:if test="${1==currentInfo.bankcreditrank}">selected</c:if>>
													A
												</option>
											</select>
										</td>
										<!--<td class="w1">企业性质：</td>
										<td class="w5">
											<select name="entproperty" id="entproperty" class="textstyle">
												<option value="1">上市公司</option>
												<option value="2">非上市公司</option>
											</select>
										</td>-->
									</tr>
									<tr class="inputrow">
										<td class="w1">纳税人登记号：</td>
										<td class="w5">
											<input type="text" name="taxpayerid"
												value="${currentInfo.taxpayerid}" class="textstyle" />
											<span class="needfill">*</span>
										</td>
										<td class="w1">法人：</td>
										<td class="w5">
											<input type="text" name="legalbody"
												value="${currentInfo.legalbody}" class="textstyle" />
												<span class="needfill">*</span>
										</td>
									</tr>
									<tr class="inputrow">
										<td class="w1">营业执照号：</td>
										<td class="w5">
											<input type="text" name="salelicenceno"
												value="${currentInfo.salelicenceno}" class="textstyle" />
											<span class="needfill">*</span>
										</td>
										<td class="w1">成立日期：</td>
										<td class="w5">
											<input type="text"  name="builddate"
												value="${currentInfo.builddate}" id="builddate" 
												onchange="isValidBuildDate(this);" 
												class="textstyle" />
											<input type="image" src="<%=basepath%>/images/common/cal.jpg" onclick="return showCalendar('builddate', 'y-mm-dd');"/>
											<span class="needfill">*</span>
										</td>
									</tr>
									<tr class="inputrow">
										<td class="w1">注册资本：</td>
										<td class="w5">
											<input type="text" name="regfound"
												value="${currentInfo.regfound}" class="textstyle" onChange="subReduNumRegFund(this,2,13)"/>
												<span class="needfill">*</span>
										</td>
										<!--<td class="w1">经营场所面积：</td>
										<td class="w5">
											<input type="text" name="bizarea"
												value="${currentInfo.bizarea}" class="textstyle" />
										</td>
										-->
									</tr>
									<!--
									<tr class="inputrow">
										<td class="w1">工人人数：</td>
										<td class="w5">
											<input type="text" name="employeenum"
												value="${currentInfo.employeenum}" class="textstyle" />
										</td>
									</tr>
									-->
									<tr>
										<td colspan="4">&nbsp;</td>
									</tr>
									<tr class="buttonrow">
										<td align="right" colspan="4">
											<input type="button" value="暂存" onclick="save();" class="btnscs" />
											&nbsp;&nbsp;
											<input type="button" value="下一步" onclick="nextStep();" class="btnscs" />
										</td>
									</tr>
								</table>
							</form>
						</td>
					</tr>
				</table>
				<div id="message" class="mycolor" >
					<c:out value="${ERROR_MESSAGE}"></c:out>
				</div>
				<b class="rbottom">
					<b class="r4"></b><b class="r3"></b>
					<b class="r2"></b><b class="r1"> </b> 
				</b>
			</div>
		</div>
	</body>